package ooptest;

public class User {
    private String zhanghu;
    private int mima;
    private String email;

    public User(String zhanghu,int mima){
        this.zhanghu=zhanghu;
        this.mima=mima;
    }

    public User(String zhanghu,int mima,String email){
        this(zhanghu,mima);
        this.email=email;
    }
    public void display(){
        System.out.println("账户："+zhanghu+"\n密码："+mima);
        if (!email.isEmpty()){
            System.out.println("邮箱："+email);
        }
    }

    public static void main(String[] args) {
        User u1=new User("猫猫",5114,"猫猫@5114.com");
        u1.display();
        System.out.println("---------");
        User u2=new User("耶耶",4115);
        u2.display();


    }
}
